package aiku.numericalcontroloa.Controller.unitMeasureController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Entity.unitMeasure.unitMeasure;
import aiku.numericalcontroloa.Service.unitMeasure.unitMeasureServiceImp;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/unitMeasure")
@Slf4j
public class unitMeasureController {

    @Autowired
    private unitMeasureServiceImp unitMeasureService;

    @GetMapping("/getUnitMeasure")
    public Result getUnitMeasure() {
        return unitMeasureService.getUnitMeasure();
    }

    @PostMapping("/addUnitMeasure")
    public Result addUnitMeasure(@RequestBody unitMeasure data) {
        return unitMeasureService.addUnitMeasure(data);
    }

    @PostMapping("/updateUnitMeasure")
    public Result setUnitMeasure(@RequestBody unitMeasure data) {
        return unitMeasureService.setUnitMeasure(data);
    }

    @PostMapping("/deleteUnitMeasure")
    public Result deleteUnitMeasure(@RequestBody unitMeasure data) {
        return unitMeasureService.deleteUnitMeasure(data);
    }
}
